﻿<%@ Page Title="" Language="C#" MasterPageFile="~/acpMaster.Master" AutoEventWireup="true" CodeBehind="participants.aspx.cs" Inherits="ACP.Web.UI.admin.participants" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMain" runat="server">
<center style="padding-top:50px; padding-bottom:50px; left:20px !important;">
 <asp:GridView ID="gvUsers" runat="server" CssClass="userdata" AllowPaging="True"
                AllowSorting="True" AutoGenerateColumns="False" 
        GridLines="Horizontal" OnRowEditing="gvUsers_RowEditing"
                DataKeyNames="userid" OnRowDataBound="gvUsers_RowDataBound" 
        OnSorting="gvUsers_Sorting" onpageindexchanging="gvUsers_PageIndexChanging" Width="80%">
                <Columns>
                    <asp:TemplateField SortExpression="firstname" HeaderText="Name"
                        HeaderStyle-HorizontalAlign="Left">
                        <ItemTemplate>
                            <%# string.Format("{0} {1}", Eval("firstname"), Eval("lastname"))%>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        <ItemStyle HorizontalAlign="left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email" SortExpression="emailid" HeaderStyle-HorizontalAlign="Left">
                        <ItemTemplate>
                            <%#string.Format("{0}", Eval("emailid") != null ? "<a href='mailto:" + Eval("emailid").ToString() + "'>" + Eval("emailid").ToString() + "</a>" : string.Empty)%>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        <ItemStyle HorizontalAlign="left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="UserName" HeaderStyle-HorizontalAlign="Left">
                        <ItemTemplate>
                            <asp:Label ID="lblRoleName" runat="server" Text='<%# Eval("login") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField SortExpression="status" HeaderText="Status" HeaderStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%# string.Format("{0}", Eval("status").ToString() == "True" ? "ACTIVE" : "<font color='red'>INACTIVE</font>")%>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="left" Width="35px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="registrationdate" HeaderText="Registerd Date" ReadOnly="True" ItemStyle-Width="35px"
                        DataFormatString="{0:MM/dd/yyyy}" SortExpression="registrationdate" HeaderStyle-HorizontalAlign="Left">
                        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        <ItemStyle Width="35px"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="center">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkEdit" runat="server" CommandName="edit" ToolTip="Edit"><img src="images/portal_icon-edit.gif" alt="Edit" width="23" height="28" border="0" /></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="center">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDelete" runat="server" key='<%#Eval("userid") %>' OnClientClick="return confirm('Do you want to delete the user?')"
                                OnClick="DeleteUser" ToolTip="delete"><img src="images/portal_icon-del.gif" alt="Edit" width="23" height="28" border="0" /></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <center>
                        <font color="red">No Users Found</font></center>
                </EmptyDataTemplate>
                <AlternatingRowStyle CssClass="alt" />
                <PagerStyle CssClass="page-links" Font-Size="10" />
            </asp:GridView>
            </center>
</asp:Content>
